{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![](https://pptwinpics.oss-cn-beijing.aliyuncs.com/CDA%E8%AE%B2%E5%B8%88%E6%B0%B4%E5%8D%B0_20200314161940.png)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using matplotlib backend: MacOSX\n"
     ]
    }
   ],
   "source": [
    "%matplotlib\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "x = [1,2,3,4,5,6,7,8,9,10]\n",
    "y = [1,2,1.5,3,5.4,6.3,7.2,7.9,8.7,10]\n",
    "\n",
    "plt.scatter(x,y,label='scatter_plot',color='r',marker='*')\n",
    "\n",
    "plt.xlabel('Age')\n",
    "plt.ylabel('Num')\n",
    "plt.title('The City')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "fig, ax = plt.subplots(2,2,figsize=(14,7))\n",
    "\n",
    "month = [1,2,3,4,5,6]\n",
    "A = [1,2,3,4,5,6]\n",
    "B = [3,4,5,6,7,8]\n",
    "\n",
    "ax[0,0].stackplot(month,A,B,labels=['1','2','3'])\n",
    "ax[1,1].stackplot(month,A,B)\n",
    "\n",
    "ax[0,0].legend(loc=10)\n",
    "\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.         0.02020202 0.04040404 0.06060606 0.08080808 0.1010101\n",
      " 0.12121212 0.14141414 0.16161616 0.18181818 0.2020202  0.22222222\n",
      " 0.24242424 0.26262626 0.28282828 0.3030303  0.32323232 0.34343434\n",
      " 0.36363636 0.38383838 0.4040404  0.42424242 0.44444444 0.46464646\n",
      " 0.48484848 0.50505051 0.52525253 0.54545455 0.56565657 0.58585859\n",
      " 0.60606061 0.62626263 0.64646465 0.66666667 0.68686869 0.70707071\n",
      " 0.72727273 0.74747475 0.76767677 0.78787879 0.80808081 0.82828283\n",
      " 0.84848485 0.86868687 0.88888889 0.90909091 0.92929293 0.94949495\n",
      " 0.96969697 0.98989899 1.01010101 1.03030303 1.05050505 1.07070707\n",
      " 1.09090909 1.11111111 1.13131313 1.15151515 1.17171717 1.19191919\n",
      " 1.21212121 1.23232323 1.25252525 1.27272727 1.29292929 1.31313131\n",
      " 1.33333333 1.35353535 1.37373737 1.39393939 1.41414141 1.43434343\n",
      " 1.45454545 1.47474747 1.49494949 1.51515152 1.53535354 1.55555556\n",
      " 1.57575758 1.5959596  1.61616162 1.63636364 1.65656566 1.67676768\n",
      " 1.6969697  1.71717172 1.73737374 1.75757576 1.77777778 1.7979798\n",
      " 1.81818182 1.83838384 1.85858586 1.87878788 1.8989899  1.91919192\n",
      " 1.93939394 1.95959596 1.97979798 2.        ]\n"
     ]
    }
   ],
   "source": [
    "x = np.linspace(0, 2, 100)\n",
    "print(x)\n",
    "\n",
    "# Note that even in the OO-style, we use `.pyplot.figure` to create the figure.\n",
    "fig, ax = plt.subplots()  # Create a figure and an axes.\n",
    "ax.plot(x, x, label='linear')  # Plot some data on the axes.\n",
    "ax.plot(x, x**2, label='quadratic')  # Plot more data on the axes...\n",
    "ax.plot(x, x**3, label='cubic')  # ... and some more.\n",
    "ax.set_xlabel('x label')  # Add an x-label to the axes.\n",
    "ax.set_ylabel('y label')  # Add a y-label to the axes.\n",
    "ax.set_title(\"Simple Plot\")  # Add a title to the axes.\n",
    "ax.legend()  # Add a legend.\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:root] *",
   "language": "python",
   "name": "conda-root-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
